<!--智慧消防V1.0-首页数据页面-->
<template>
  <div class="dashboard-container">
    <component :is="currentRole" />
  </div>
</template>

<script>
import adminDashboard from "./test.vue";
import qyDashboard from "./qy.vue";
import wbDashboard from "./wb.vue";
export default {
  name: "Dashboard",
  components: { adminDashboard, qyDashboard, wbDashboard },
  data() {
    return {
      currentRole: "adminDashboard",
    };
  },
  computed: {
    admin() {
      let roleCode = this.$store.getters.roleCode;
      return (
        roleCode == "SUPER" ||
        roleCode == "ADMIN" ||
        roleCode == "XT-ADMIN" ||
        roleCode == "ZD-ADMIN" ||
        roleCode == "DD-ADMIN"
      );
    },
    wb() {
      let roleCode = this.$store.getters.roleCode;
      return roleCode == "WB-ADMIN" || roleCode == "WB-YH";
    },
    qy() {
      let roleCode = this.$store.getters.roleCode;
      return roleCode == "XZ-ADMIN" || roleCode == "XZ-YH";
    },
  },
  created() {
    if (this.admin) {
      this.currentRole = 'adminDashboard'
    } else if (this.qy) {
      this.currentRole = 'qyDashboard'
    } else if (this.wb) {
      this.currentRole = 'wbDashboard'
    }
  },
  methods: {},
};
</script>

<style scoped>
.dashboard-container {
  width: 100%;
  height: 100%;
}
</style>
